<template>
  <div id="app">
    
    <mt-header fixed title="黑马Vue项目">
      <span @click.prevent="$router.back(-1)"  slot="left" v-if="this.$route.path != '/home'">
      <mt-button icon="back">返回</mt-button>
    </span>
    </mt-header>

    <router-view></router-view>

    <!-- 底部导航 -->
    <nav class="mui-bar mui-bar-tab">
      <router-link class="tab-item" to="/home">
        <span class="mui-icon mui-icon-home"></span>
        <span class="mui-tab-label">首页</span>
      </router-link>
      <router-link class="tab-item" to="/member">
        <span class="mui-icon mui-icon-contact"></span>
        <span class="mui-tab-label">会员</span>
      </router-link>
      <router-link class="tab-item" to="/shopcar">
        <span class="mui-icon mui-icon-contact"><span class="mui-badge">{{ $store.getters.getAllCounts }}</span></span>
        <span class="mui-tab-label">购物车</span>
      </router-link>
      <router-link class="mui-tab-item" to="/search">
        <span class="mui-icon mui-icon-gear"></span>
        <span class="mui-tab-label">设置</span>
      </router-link>
    </nav>
  </div>
</template>

<style lang="less" scoped>
#app {
  font-family: "Avenir", Helvetica, Arial, sans-serif;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  // text-align: center;
  color: #2c3e50;
  margin: 40px 0 50px 0;
}
#nav {
  padding: 30px;
  a {
    font-weight: bold;
    color: #2c3e50;
    &.router-link-exact-active {
      color: #42b983;
    }
  }
}
* {
  touch-action: pan-y;
  -webkit-overflow-scrolling: touch;
}
/deep/.mui-bar {
  display: block;
  z-index: 999;
  bottom: 0;
  position: fixed;
}
.mui-bar-tab .tab-item{
      display: table-cell;
    overflow: hidden;
    width: 1%;
    height: 50px;
    text-align: center;
    vertical-align: middle;
    white-space: nowrap;
    text-overflow: ellipsis;
    color: #929292;
}
.mui-bar-tab .tab-item.mui-active {
    color: #007aff;
}

.mui-bar-tab .tab-item .mui-icon {
    top: 3px;
    width: 24px;
    height: 24px;
    padding-top: 0;
    padding-bottom: 0;
}
.mui-bar-tab .tab-item .mui-icon ~ .mui-tab-label {
    font-size: 11px;
    display: block;
    overflow: hidden;
    text-overflow: ellipsis;
}
/deep/ ul{
  list-style: none;
  margin: 0;
  padding: 0;
}
</style>
